package com.epam.traning.taskmanager.adapter;

import android.content.Context;
import android.database.Cursor;
import android.support.v4.widget.CursorAdapter;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.epam.traning.taskmanager.R;
import com.epam.traning.taskmanager.content.contract.TaskContract;

public class TaskCursorAdapter extends CursorAdapter {
	
	public TaskCursorAdapter(Context context, Cursor c) {
		super(context, c, true);
	}

	@Override
	public void bindView(View view, Context arg1, Cursor cursor) {
		TextView textView1 = (TextView) view.findViewById(android.R.id.text1);
		TextView textView2 = (TextView) view.findViewById(android.R.id.text2);
		textView1.setText(cursor.getString(cursor.getColumnIndex(TaskContract.TasksColumns.NAME)));
	}

	@Override
	public View newView(Context ctx, Cursor arg1, ViewGroup arg2) {
		View view = View.inflate(ctx, R.layout.adapter_task, null);
		return view;
	}

	
}
